package com.kmxd.ams.core.license.verify.config;

import com.kmxd.ams.license.core.model.LicenseVerifyParam;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/** License验证属性类 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class LicenseVerifyProperties {
  private String subject = "kmxdkj";
  private String publicAlias = "publicKmxdkjCert";
  private String publicKeysStorePath = "/publicCerts.keystore";
  private String storePass = "pubXdkj1234";
  private String licensePath = "license.lic";
  private String licenseCode = null;

  public LicenseVerifyParam getVerifyParam() {
    String tempDir = System.getProperty("java.io.tmpdir");
    return LicenseVerifyParam.builder()
        .subject(subject)
        .publicAlias(publicAlias)
        .storePass(storePass)
        .licensePath(tempDir + licensePath)
        .publicKeysStorePath(publicKeysStorePath)
        .licenseCodeBase64(licenseCode)
        .build();
  }

}
